Face Mask Detection

This notebook is an exercise of Nueral Network for Computer Vision course at Afeka College of Engeneering.
It involves a Multi-Label Object Detection task using Kaggle's Face Mask Detection dataset.

Table of Contents:

Submitted By:

Imports

Configurations

Data Load

Load the data into a dataset

Data Exploration

Images and Labels Count

Classes Distribution

Classes Combinations Distribution

We can understand from these two cahrts that the data is very imbalanced.
For example, there are only 123 faces with an incorrect weared mask, those faces appearing in (21 + 30 + 4 + 42) = 97 images, which is (97 / 853) = 11% of all the images.
On the other hand, faces with masks appearing in (768 / 853) = 90% of all the images.
Therefore, in later part of the training, we will have to split the train and validation sets in a good managers.

Number of Faces per Image

Spliting the Data

As have seen above, the data is tvery imbalaned.
There are inconsistence amount of faces per image, and high differences in the total amount of appearance of each class.
For better training, we would like to use Cross-Validation.
We encounter with two main probelms: first, our data is imbalanced, therefore using regular spliting methods, will might cause some classes to not appear at all in some folds, second, out task involve Multi-label Object Detection, and the well-known spliting algorithm won't work with.
The first problem is encountered with Stratified KFold splits the folds by preserving the percentage of samples for each label.
The second problem cannot be encountered with scikit-learn's algorithm, therefore we will use MultilabelStratifiedKFold implentation which taken from here.

From the information above, it is possible to see that MultilabelStratifiedKFold split the images into almost identical train-test sizes in each fold, while preserving the amount of labels from each class within the different folds.

Data Samples

Training

Evaluation

Examples

Mean Average Precision

mAP@[0.5:0.05:0.95]

References